<template>
  <div>
    <Header :active="1"/>
    <div class="home-content">
      <div class="adv-banner" style="background-color: #000">
        <el-carousel indicator-position="outside" :height="bannerHeight+'px'">
          <el-carousel-item>
            <video
              webkit-playsinline="true"
              loop="loop"
              playsinline="true"
              autoplay=""
              src="https://chiship.oss-cn-shanghai.aliyuncs.com/ExpectX/banner01.mp4"
              class="pc_dom" poster="../../static/image/banner01.jpg"
             :width="bannerWidth"   style=" width: 100%; margin-top: 0px; visibility: visible;"></video>
          </el-carousel-item>
          <el-carousel-item>
            <img src="../../static/image/banner.jpg" ref="bannerImage" :style="{height:bannerHeight+'px'}" id="bannerImage" name="bannerImage"/>
          </el-carousel-item>

        </el-carousel>
      </div>
      <div class="services-adv">
        <el-row class="common-width" >
          <el-col :span="3">
            <div class="grid-content">
              <div class="title">高品质软件与服务</div>
              <div class="desc">开放者工具、建站、API、企业应用，支撑云端服务应用</div>
            </div>
          </el-col>
          <el-col :span="3">
            <div class="grid-content">
              <div class="title">高品质软件与服务</div>
              <div class="desc">开放者工具、建站、API、企业应用，支撑云端服务应用</div>
            </div>
          </el-col>
          <el-col :span="3">
            <div class="grid-content">
              <div class="title">高品质软件与服务</div>
              <div class="desc">开放者工具、建站、API、企业应用，支撑云端服务应用</div>
            </div>
          </el-col>
          <el-col :span="3">
            <div class="grid-content">
              <div class="title">高品质软件与服务</div>
              <div class="desc">开放者工具、建站、API、企业应用，支撑云端服务应用</div>
            </div>
          </el-col>
          <el-col :span="3">
            <div class="grid-content">
              <div class="title">高品质软件与服务</div>
              <div class="desc">开放者工具、建站、API、企业应用，支撑云端服务应用</div>
            </div>
          </el-col>
        </el-row>
      </div>

      <div class="services-domain">
        <div class="title">期待未来，技术解决方案变革产品创建与服务方式</div>
        <div class="desc">行业解决方案，定制化开发与实施到系统维护的一站式服务</div>
        <div class="common-width content">
          <el-row>
            <el-col :span="8">
              <div class="grid-content">
                <img src="../../static/image/yiliao.png" class="logo">
                <div class="title">医疗健康</div>
                <div class="desc">病种结构监控、医院绩效考核、医疗 质量评价等</div>
              </div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content">
                <img src="../../static/image/tiyu.png" class="logo">
                <div class="title">体育领域</div>
                <div class="desc">提供完整视频数据的集中信息系统 包含许多软件应用，硬件和专业服务</div>
              </div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content">
                <img src="../../static/image/zhengwu.png" class="logo">
                <div class="title">政府政务</div>
                <div class="desc">提供完整视频数据的集中信息系统 包含许多软件应用，硬件和专业服务</div>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="blue">
        <div class="common-width solution-service" >
           <el-row>
             <el-col :span="5">
               <div class="wrap">
                 <div class="inner">
                   <a href="javascript:void (0)">
                     <img src="../../static/image/small-1.png" class="imgDiv">
                     <div class="title">APP解决方案</div>
                   </a>
                 </div>
               </div>
             </el-col>
             <el-col :span="5">
               <div class="wrap">
                 <div class="inner">
                   <a href="javascript:void (0)">
                     <img src="../../static/image/small-2.png" class="imgDiv">
                     <div class="title">网站解决方案</div>
                   </a>
                 </div>
               </div>
             </el-col>
             <el-col :span="5">
               <div class="wrap">
                 <div class="inner">
                   <a href="javascript:void (0)">
                     <img src="../../static/image/small-3.png" class="imgDiv">
                     <div class="title">体育解决方案</div>
                   </a>
                 </div>
               </div>
             </el-col>
             <el-col :span="5">
               <div class="wrap">
                 <div class="inner">
                   <a href="javascript:void (0)">
                     <img src="../../static/image/small-4.png" class="imgDiv">
                     <div class="title">医疗解决方案</div>
                     <div class="description">
                       融合云计算、大数据优势，连接用户、医疗设备、医疗机构以及医疗ISV，致力于构建大健康行业云生态。
                     </div>
                   </a>
                 </div>
               </div>
             </el-col>
             <el-col :span="5">
               <div class="wrap">
                 <div class="inner">
                   <a href="javascript:void (0)">
                     <img src="../../static/image/small-5.png" class="imgDiv">
                     <div class="title">政务解决方案</div>
                   </a>
                 </div>
               </div>
             </el-col>
           </el-row>
        </div>
      </div>
      <div style="background-color: #fff">&nbsp;</div>
      <div class="news">
        <div class="big-title">新闻中心</div>
        <div class="common-width content">
          <el-row>
            <el-col :span="12">
              <img src="../../static/image/news.png">
              <div class="content-desc">
                <el-row>
                  <el-col :span="12" class="left">
                    <div>18</div>
                    <div>{{ dateFormat(newsTop.gmtCreate,'yyyy-MM-dd ')}}</div>
                  </el-col>
                  <el-col :span="12"  class="right">
                    <div class="title"><a @click="goMore(newsTop.id)">{{newsTop.title}}</a> </div>
                    <el-divider></el-divider>
                    <div class="desc">
                      {{newsTop.description}}
                    </div>
                  </el-col>
                </el-row>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="news-news">
                <div class="news-item first-item">
                  <el-row>
                    <el-col :span="16" >
                      <div class="title"><a @click="goMore(newsRight.id)">{{newsRight.title}}</a> </div>
                      <div class="desc">
                        {{newsRight.description}}
                      </div>
                    </el-col>
                    <el-col :span="8" class="time">
                      <div>18</div>
                      <div>{{ dateFormat(newsRight.gmtCreate,'yyyy-MM-dd ')}}</div>
                      <div>
                        <i class="el-icon-arrow-right"></i>
                      </div>
                    </el-col>
                  </el-row>

                </div>
                <div class="news-item" v-for=" items in news">
                  <div class="news-item-header">
                    <div class="title fl"><a @click="goMore(items.id)">{{items.title}}</a></div>
                    <div class="time fr">{{ dateFormat(items.gmtCreate,'yyyy-MM-dd ')}}</div>
                  </div>
                </div>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="news-footer">
          <a href="#/news"><el-button plain>查看更多</el-button></a>
        </div>
      </div>
      <div class="desc001">
        <span>期待未来</span><span>，技术解决方案变革产品创建与服务方式</span>
      </div>
    </div>
    <Footer/>
  </div>
</template>

<script>
  import Header from '@/components/Header' // Secondary package based on el-pagination
  import Footer from '@/components/Footer' // Secondary package based on el-pagination
  import {formatDate} from '@/utils/global'
  export default {
    components: {Header,Footer},
    filters: {},
    watch: {
      "$route": "reload"    //后面是methods中的一个方法
    },
    data() {
      return {
        // 视频播放
        playerOptions : {
          playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
          autoplay: true, //如果true,浏览器准备好时开始回放。
          muted: false, // 默认情况下将会消除任何音频。
          loop: true, // 导致视频一结束就重新开始。
          preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频（如果浏览器支持）
          language: 'zh-CN',
          aspectRatio: '16:9', // 将播放器置于流畅模式，并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字（例如"16:9"或"4:3"）
          fluid: true, // 当true时，Video.js player将拥有流体大小。换句话说，它将按比例缩放以适应其容器。
          sources: [{
            type: "video/mp4",
            src: "https://chiship.oss-cn-shanghai.aliyuncs.com/video.webm"
          }],
          poster: "", //你的封面地址
          // width: document.documentElement.clientWidth,
          notSupportedMessage: '此视频暂无法播放，请稍后再试', //允许覆盖Video.js无法播放媒体源时显示的默认信息。
          controlBar: {
            timeDivider: false,
            durationDisplay: false,
            remainingTimeDisplay: false,
            fullscreenToggle: false  //全屏按钮
          }
        },
        bannerHeight:window.screen.availHeight-130,
        bannerWidth:window.screen.availWidth-57,

        news: [],
        newsTop:{},
        newsRight:{},
      }
    },
    created() {
    //  this.fetchData();
      let _self = this;
      _self.$store.dispatch('news', {}).then(response => {
        this.news = response.data;
        this.newsTop = this.news[0];
        this.newsRight = this.news[1];
        this.news = this.news.splice(2, response.data.length);
      }).catch(() => {
      })
    },
    methods: {
      init(){


      },
      fetchData() {

        let _self = this;
        _self.$store.dispatch('statisticsProjectStatus', {}).then(response => {
          _self.list = response.data;
          _self.total = response.count;
        }).catch(() => {
        })
      },
    dateFormat(d, fmt) {
      return formatDate(d, fmt);
    },
      goMore(id){
        this.$router.push({ path:'/news/'+id+''  })
      },
    }
  }

</script>
<style>
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 200px;
    margin: 0;
  }

/*  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }*/
</style>
